package com.jialiang;

import java.io.File;

public class FileDemo {
    public static void main(String[] args) {

        //地块
        String[] massif = new String[]{"4-1", "4-2", "7-4"};
        String[] Building = new String[]{"A", "B", "C", "D"};
        for (int j = 0; j < 3; j++) {
            File file = new File(massif[j]);
            makerFolder(file);
            for (int x = 0; x < 4; x++) {
                File files = new File(file, massif[j]+"-"+Building[x]);
                makerFolder(files);
                for (int i = 1; i <= 8; i++) {
                    //第二层文件夹
                    String s = massif[j] + "-0" + i + "F";

                }
            }
        }

    }

    public static void makerFolder(File folder) {
        try {
            // 如果文件夹不存在，则创建它
            if (!folder.exists()) {
                folder.mkdir();
                System.out.println("Folder created successfully!");
            } else {
                System.out.println("Folder already exists!");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
